import request from '@/utils/request'

// 获取资产设备管理列表
export const getAssetsListAPI = (params) => {
  return request({
    url: '/device/index',
    method: 'get',
    params
  })
}

// 新增资产设备
export const addAssetsAPI = (data) => {
  return request({
    url: '/device/index',
    method: 'post',
    data
  })
}

// 修改资产设备数据回显
export const getAssetsInfoAPI = (id) => {
  return request({
    url: '/device/index/' + id,
    method: 'get',
  })
}

// 修改资产设备
export const editAssetsAPI = (data) => {
  return request({
    url: '/device/index/' + data.id,
    method: 'put',
    data
  })
}

// 删除资产设备
export const delAssetsAPI = (id) => {
  return request({
    url: '/device/index/' + id,
    method: 'delete',
  })
}

// 获取维修管理管理列表
export const getMaintainListAPI = (params) => {
  return request({
    url: '/device/maintain',
    method: 'get',
    params
  })
}

// 新增维修管理
export const addMaintainAPI = (data) => {
  return request({
    url: '/device/maintain',
    method: 'post',
    data
  })
}

// 修改维修管理数据回显
export const getMaintainInfoAPI = (id) => {
  return request({
    url: '/device/maintain/' + id,
    method: 'get',
  })
}

// 修改维修管理
export const editMaintainAPI = (data) => {
  return request({
    url: '/device/maintain/' + data.id,
    method: 'put',
    data
  })
}

// 删除维修管理
export const delMaintainAPI = (id) => {
  return request({
    url: '/device/maintain/' + id,
    method: 'delete',
  })
}